home *** CD-ROM | disk | FTP | other *** search
/ Champak 106 / Vol 106.iso / games / insuranc.swf / scripts / __Packages / Front.as < prev    next >
Encoding:
Text File  |  2010-04-12  |  1.1 KB  |  42 lines

  1. class Front extends MovieClip
  2. {
  3.    var btnPlay;
  4.    var btnQuote;
  5.    var btnKerb;
  6.    var oKeyList;
  7.    function Front(Void)
  8.    {
  9.       super();
  10.       this.setButtons();
  11.    }
  12.    function setButtons(Void)
  13.    {
  14.       this.btnPlay.onRelease = mx.utils.Delegate.create(this,this.onReleasePlay);
  15.       this.btnQuote.onRelease = mx.utils.Delegate.create(this,this.onReleaseQuote);
  16.       this.btnKerb.onRelease = mx.utils.Delegate.create(this,this.onReleaseKerb);
  17.       this.oKeyList = new Object();
  18.       this.oKeyList.onKeyDown = mx.utils.Delegate.create(this,this.onPressSpace);
  19.       Key.addListener(this.oKeyList);
  20.    }
  21.    function onReleasePlay(Void)
  22.    {
  23.       Key.removeListener(this.oKeyList);
  24.       _root.gotoAndStop("game");
  25.    }
  26.    function onReleaseQuote(Void)
  27.    {
  28.       this.getURL("http://www.easymoneyinsurance.com","_blank");
  29.    }
  30.    function onReleaseKerb(Void)
  31.    {
  32.       this.getURL("http://www.kerb.co.uk","_blank");
  33.    }
  34.    function onPressSpace(Void)
  35.    {
  36.       if(Key.isDown(32))
  37.       {
  38.          this.onReleasePlay();
  39.       }
  40.    }
  41. }
  42.